package com.eh.controller;

import com.eh.base.BaseController;
import com.eh.base.ResponseWrapper;
import com.eh.dto.request.AccountDetailRequest;
import com.eh.dto.response.AccountDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.eh.service.AccountApiManager;

/**
 * Created by David on 2016/5/14.
 */
@Controller
@RequestMapping("accounts")
public class AccountController extends BaseController {
    @Autowired
    private AccountApiManager accountApiManager;

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public ResponseWrapper findUserById(@PathVariable String id) {
        AccountDetailRequest accountDetailRequest = new AccountDetailRequest();
        accountDetailRequest.setId("001");
        AccountDetail accountDetail = accountApiManager.findAccountDetailById(accountDetailRequest);
        return new ResponseWrapper(accountDetail);
    }
}
